Signed app-store catalogue + Pages catalogue site#249
Merged
Conversation
Replace the placeholder catalogue trust anchor with a real embedded ed25519 key (internal/catalogtrust, ldflags-overridable for rotation): - pilotctl loadCatalogue fetches a detached <url>.sig and verifies it against the embedded key before trusting any entry; unsigned, missing, or tampered catalogues are refused. - New 'pilotctl appstore sign-catalogue' writes the detached signature and refuses to sign with a key that doesn't match the embedded public key. - cmd/daemon passes the embedded key into appstore.Config.CatalogPubkey, retiring the all-zeros placeholder at the wire-up point. - Sign catalogue.json; document signing + key rotation in catalogue README. Tests: catalogtrust verify (happy/tamper/short/no-key), signed-catalogue load + fail-closed (missing sig, tamper).
Dependency-free page (catalogue/site/index.html) that fetches catalogue.json same-origin and renders one card per app (id, version, description, install command, bundle link; methods when an entry provides them). The Pages deploy workflow is added separately (requires workflow scope on the push token).
…st fixtures The previous catalogue trust anchor's private key (publicKeyB64 = "5aCD92R0UoZ2lGW6PYZeRrDw63ZNBC5oJZxFB8RNOPQ=") was lost and is unrecoverable, so the committed catalogue.json.sig could never be regenerated to match an edited catalogue. This anchor existed only on this PR branch — not on main and not in any shipped binary — so rotating it now has zero installed-base impact. Changes: - Generate a fresh ed25519 release keypair (private key stored only outside the repo, never committed) and embed its public half as the new trust anchor: publicKeyB64 = "iHdBWayA/hYjkwUOZopTXY70qOlR90d6ii/hin0ZMdI=" - Re-sign catalogue/catalogue.json with the new key (catalogue/catalogue.json.sig), which now verifies fail-closed against the embedded key. - Fix the test fixtures #255 left unsigned: stageCatalogue now signs each fixture with a per-test ephemeral key (swapped into the embedded anchor for the test's duration via catalogtrust.SignWithEphemeralKey, restored on cleanup). Tests exercise REAL fail-closed verification against a VALID signature — the gate is not skipped, disabled, or weakened; the negative tests (missing-signature, tamper) still pass. Rebased onto origin/main, reconciling #255's v2 metadata schema with this branch's catalogue signing (kept the fail-closed sig gate in loadCatalogue, both `view` and `sign-catalogue` subcommands, and main's metadata pin discipline in catalogue/README.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
15f1ea9 to
016d43d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the two app-store catalogue tasks on the web4 side:
1. Signed catalogue, verified fail-closed (replaces the all-zeros trust anchor)
internal/catalogtrustholds the embedded ed25519 cataloguepublic key (override at build time via
-ldflags -X …/catalogtrust.publicKeyB64=<b64>to rotate).pilotctlloadCataloguenow fetches a detached<url>.sigandverifies it against the embedded key before trusting any entry.
Unsigned, missing-signature, or tampered catalogues are refused.
pilotctl appstore sign-catalogue --key <key> <catalogue.json>writes the detached signature and refuses to sign with a key that
doesn't match the embedded public key (no dead signatures).
cmd/daemonpasses the embedded key intoappstore.Config.CatalogPubkey,retiring the all-zeros placeholder at the wire-up point.
catalogue.jsonis signed (catalogue.json.sigcommitted); READMEdocuments the signing + key-rotation flow.
2. Static catalogue site (GitHub Pages)
catalogue/site/index.html— dependency-free page that fetchescatalogue.jsonsame-origin and renders one card per app (id, version,description, install command, bundle link; methods when present).
Testing
go build ./...clean (daemon + pilotctl + all packages).go test ./internal/catalogtrust/ ./cmd/pilotctl/green, incl. thesigned-catalogue load + fail-closed (missing sig / tamper) tests and the
catalogtrust verify unit tests.
workflowscope to push)The deploy workflow below could not be pushed from this environment —
the push token lacks the
workflowOAuth scope. Please add it as.github/workflows/deploy-catalogue-site.yml:It assembles
_site(page +catalogue.json+.sig) and deploys toPages on changes under
catalogue/.